<%@ page language="java"
	import="java.util.List, com.user.bean.User, com.book.bean.Book,
com.booktype.bean.Booktype, com.opensymphony.xwork2.ActionContext"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>book type info</title>
</head>

<body>
	<s:action name="typeAction" namespace="/"></s:action>
	<%
		List<Booktype> typeList = (List<Booktype>) (ActionContext
				.getContext().getSession().get("booktype"));
		if (typeList != null) {
			for (int i = 0; i < typeList.size(); ++i) {
				out.print("<p>" + typeList.get(i) + "</p>");
			}
		} else {
			out.print("<p>the session is null</p>");
		}
		Object name = ActionContext.getContext().getSession().get("user");
		if (name != null) {
			out.print("<p>username: " + name + "</p>");
		} else {
			out.print("<p>the name is null</p>");
		}

		List<Book> books = (List<Book>) (ActionContext.getContext()
				.getSession().get("allbook"));
		if (books != null) {
			for (int i = 0; i < books.size(); ++i) {
				out.print("<p>" + books.get(i) + "</p>");
			}
		} else {
			out.print("<p>the book is null</p>");
		}
	%>

	<ul>
		<li>所有图书类型</li>
		<s:iterator value="#request.allBook">
			<li>图书类型ID：<s:property value="type_id" />
			</li>
			<li>图书类型名：<s:property value="type_name" />
			</li>
			<li>图书类型描述：<s:property value="description" />
			</li>
		</s:iterator>
	</ul>
</body>
</html>